<?php

$__FILEPATH__ = dirname(__FILE__)."/";
require_once($__FILEPATH__."./func_common.php");
require_once($__FILEPATH__."./class_def.php");
require_once($__FILEPATH__."./conf/info.php");
session_start();

if (!isset($_SESSION["user"]))
{
	header("Location: ./loginpage.php");
	exit(0);
}

header("Content-Type: text/html; charset=UTF-8");
$mysqli = GetMysqliInstance();

if (isset($_GET["id"]))
{
	$id = intval($_GET["id"]);
	$username = $_SESSION["user"];
	$mysqli->query("delete from msglist where id = $id and (user = '$username' or bid in (select id from bloglist where user = '$username'))");
}

$mysqli->close();

echo "<script type='text/javascript'>history.go(-1);</script>";

?>

